package com.znh.entity;

import com.znh.common.RedisQuery;
import com.znh.common.Utils;
import com.znh.main.MainFrame;

import javax.rmi.CORBA.Util;

/**
 * @version 1.0
 * @Author znh
 * @Date 2024/6/3 下午4:42
 * @注释 局面评论类
 */
public class Comment {
    /**
     * 局面
     */
    public static String phase;

    /**
     * 注释
     */
    public static String note;


    public static void getComment() {
        new Thread(()->{
            String tempPhase=GameRule.getISREVERSE()? Utils.phaseReverse(phase):phase;
            note = RedisQuery.getByKey(tempPhase);
            MainFrame.comment.setText(note);
        }).start();
    }

    public static void setComment(String note) {
        new Thread(()->{
            String tempPhase=GameRule.getISREVERSE()? Utils.phaseReverse(phase):phase;
            RedisQuery.set(tempPhase,note);
            Comment.note=note;
        }).start();
    }


}
